package designpatternssimple.statePattern;

/**
 * 状态模式
 * http://c.biancheng.net/view/1388.html
 * 环境类
 */
public class ScoreContext {
    private AbstractState state;
    ScoreContext() {
        state = new LowState(this);
    }
    public void setState(AbstractState state) {
        this.state = state;
    }
    public AbstractState getState() {
        return state;
    }
    public void add(int score) {
        state.addScore(score);
    }
}
